package cn.AssassinG.ScsyERP.Statistics.facade.enums;

import java.util.HashMap;
import java.util.Map;

public enum ObjectType {
    Corporation("承运方", 0),
    Truck("货车", 1),
    Driver("驾驶员", 3),
    Escort("押运员", 4),
    Customer("客户", 5),
    Manufacturer("生产厂家", 6),
    Consignee("收货方", 7);

    private String Name;
    private Integer Value;

    static Map<String, ObjectType> enumMap = new HashMap<String, ObjectType>();
    static{
        for(ObjectType type : ObjectType.values()){
            enumMap.put(type.getName(), type);
        }
    }

    private ObjectType(String name, Integer value) {
        Name = name;
        Value = value;
    }

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public Integer getValue() {
        return Value;
    }

    public void setValue(Integer value) {
        Value = value;
    }

    public static ObjectType getEnum(String name){
        return enumMap.get(name);
    }

    static Map<Integer, ObjectType> intMap = new HashMap<>();
    static{
        for(ObjectType type : ObjectType.values()){
            intMap.put(type.getValue(), type);
        }
    }
    public static ObjectType getEnum(Integer value){
        return intMap.get(value);
    }
}
